package com.yuhouxinliang.service.base.exception;

import com.yuhouxinliang.common.base.result.ResultCodeEnum;
import lombok.Data;


@Data
public class YuHouXinLiangException extends RuntimeException {

    private Integer code;

    public YuHouXinLiangException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public YuHouXinLiangException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }

    @Override
    public String toString() {
        return "YuHouXinLiangException{" +
                "code =" + code +
                ", message =" + this.getMessage() +
                '}';
    }
}
